package cn.u313.comm.conststring;

import cn.u313.comm.utils.TxtUtil;
import cn.u313.entry.DragonBoatFestivalEntry;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import static cn.u313.config.BotConfig.hongBaos;
import static cn.u313.config.BotConfig.yb;

public class 粽子 {
    public static final String 打劫赠送 = "打劫赠送";
    public static final String 签到赠送 = "签到赠送";


    public static final String 包粽子 = "包粽子";
    public static final String 吃粽子 = "吃粽子";
    public static final String 送粽子 = "送粽子";
    public static final String 抢粽子 = "抢粽子";
    public static final String 万粽归心 = "万粽归心";



    public static String zzRo1 = "白米咸粽";
    public static String zzRo2 = "八宝咸粽";
    public static String zzRo3 = "八宝甜粽";

    static boolean[] tx={false,true};
    static String[] zz={
            "红枣粽",
            "赤豆粽",
            "豆蓉粽",
            "腊肉粽",
            "鲜肉粽",
            "白米粽",
            "绿豆粽",
            "花生粽",
            "芭蕉粽",
            "八宝粽",
            "烧肉粽"
    };
    private static String zzs=
            "红枣粽赤豆粽豆蓉粽腊肉粽鲜肉粽白米粽绿豆粽花生粽芭蕉粽八宝粽烧肉粽";

    /**
     * 是否存在该粽子
     * @param str
     * @return
     */
    public static boolean haszz(String str){
        return zzs.contains(str);
    }
    public static String toZongZi(String name ,boolean is){
        if (is)return name.replaceAll("粽","咸粽");
        return name.replaceAll("粽","甜粽");
    }
    /**
     * 吃粽子抽奖
     */
    public static int eatYb(){
        int m = (int) (Math.random() * yb.length-20+Math.random()*20);
        return yb[m>0?m:m/2-m];
    }
    /**
     * 吃粽子抽奖
     */
    public static double eatHb(){
        return hongBaos[(int) (Math.random() * hongBaos.length)];
    }

    public static String random() {
        return TxtUtil.radomTxt(zz);
    }

    public static boolean randomtx() {
        boolean b  = TxtUtil.radombool(tx);
        System.out.println(b);
        return b;
    }


    public static String toZongZir() {
        return toZongZi(random(),randomtx());
    }

    public static void main(String[] args) {
        String[] a={"a","b","c","d"};
        List<String> dragonBoatFestivalEntryList = Arrays.stream(a)
                .filter((String b) -> b.equals("a") || b.equals("b") || b.equals("c"))
                .collect(Collectors.toList());
        System.out.println(dragonBoatFestivalEntryList);
    }

    static String strzs = "";

    /**
     * 显示粽子列表
     * @return
     */
    public static String 包粽子() {
        if (strzs.length()>10)return strzs;
        for (String s : zz) {
            strzs+="\n(甜，咸) "+s;
        }
        return strzs;
    }
}
